package cn.iocoder.yudao.module.diy.dal.mysql.poster;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.diy.dal.dataobject.poster.PosterDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.diy.controller.admin.poster.vo.*;

/**
 * 装修海报 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PosterMapper extends BaseMapperX<PosterDO> {

    default PageResult<PosterDO> selectPage(PosterPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PosterDO>()
                .eqIfPresent(PosterDO::getAddonId, reqVO.getAddonId())
                .likeIfPresent(PosterDO::getName, reqVO.getName())
                .eqIfPresent(PosterDO::getType, reqVO.getType())
                .eqIfPresent(PosterDO::getChannel, reqVO.getChannel())
                .eqIfPresent(PosterDO::getValue, reqVO.getValue())
                .eqIfPresent(PosterDO::getStatus, reqVO.getStatus())
                .eqIfPresent(PosterDO::getAddon, reqVO.getAddon())
                .betweenIfPresent(PosterDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PosterDO::getId));
    }

}